﻿/*
 * @author: wizardc
 */

using UnityEngine;

namespace Dou.UI
{
    /// <summary>
    /// 广告牌
    /// </summary>
    public class Billboard : MonoBehaviour
    {
        public Camera camera;

        void Awake()
        {
            if (camera == null)
            {
                camera = Camera.main;
            }
        }

        void Update()
        {
            var cameraRotation = camera.transform.rotation;
            transform.LookAt(transform.position + cameraRotation * Vector3.forward, cameraRotation * Vector3.up);
        }
    }
}
